package com.linq.cool.beauty.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.linq.cool.beauty.domain.BeautyRefund;
import com.linq.cool.beauty.dto.BeautyRefundQueryDTO;
import com.linq.cool.beauty.service.BeautyRefundService;
import com.linq.cool.common.core.domain.BaseController;
import com.linq.cool.common.core.domain.PageVO;
import com.linq.cool.common.core.domain.Result;
import com.linq.cool.common.security.annotation.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: yqlin
 * @Date: 2021/2/3 19:29
 * @Description: 退费记录表
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("refund")
public class BeautyRefundController extends BaseController {
    @Autowired
    private BeautyRefundService beautyRefundService;

    @PreAuthorize(hasPerm = "beauty:refund:list")
    @GetMapping("list")
    public Result<?> list(BeautyRefundQueryDTO dto) {
        IPage<BeautyRefund> page = beautyRefundService.listByPage(dto.getPage(), dto);
        return Result.ok(new PageVO().setTotal(page.getTotal()).setRecords(page.getRecords()));
    }

}
